<%include file="include/head.html"%>
<div class="wrapper">
  <div id="div-home" class="main-info-box">
    <%include file="include/crumbs.html"%>
    <nav id="nav" class="second-level-nav">
      <ul>
	<%if $authorized || $user.open eq 'public'%>
	<li><a href="/tree/index?userid=<%$user.id%>">查看家谱</a></li>
	<li><a href="/users/album?userid=<%$user.id%>">查看相册</a></li>
	<%if $session.id == $user.creator && $user.state == RESOURCE_STATE_DELETED%>
        <li><a href="/users/restore?userid=<%$user.id%>">恢复</a></li>
	<%else%>
	<li><a href="/users/edit?userid=<%$user.id%>">编辑/纠错</a></li>
	<%/if%>
	<%/if%>
      </ul>
      <%include file="include/left_ad.html"%>
    </nav>
    <div class="div-info-body">
      <div itemscope itemtype="/Public/person.html">
	<div class="figure">
	  <img itemprop="figure" src="<%$user.figureurl%>" alt="<%$user.realname%>"/>
	</div>
	<dl class="dl-base-info">
	  <dt>姓名：</dt>
	  <dd itemprop="name"><%$user.realname%></dd>
	  <dt>性别：</dt>
	  <dd itemprop="gender"><%$user.gender_str%></dd>
	  <dt>出生：</dt>
	  <dd itemprop="day_of_birth"><%$user.day_of_birth%></dd>
	  <dt>地域：</dt>
	  <dd itemprop="region"><%$user.region%></dd>
	  <dt>开放：</dt>
	  <%assign var="open_state" value=$user.open%>
	  <dd itemprop="open"><%$open.$open_state%></dd>
	  <dt>状态：</dt>
          <dd><%$STATE[$user.state]%></dd>
	</dl>
	
	<!-- family -->
        <dl class="dl-family">
          <dt>父亲：</dt>
          <dd itemprop="fathers">
	    <%if $fathers|@count gt 0%>
            <ul class="home-members">
	      <%foreach from=$fathers item=father%>
	      <li>
		<a href="/users/home/?userid=<%$father.id%>"><%$father.realname%></a>
	      </li>
	      <%/foreach%>
	    </ul>
	    <%/if%>
	  </dd>

          <dt>母亲：</dt>
          <dd itemprop="mothers">
	    <%if $mothers|@count gt 0%>
            <ul class="home-members">
	      <%foreach from=$mothers item=mother%>
	      <li>
		<a href="/users/home/?userid=<%$mother.id%>"><%$mother.realname%></a>
	      </li>
	      <%/foreach%>
	    </ul>
	    <%/if%>
	  </dd>
          <dt>配偶：</dt>
          <dd itemprop="mates">
	    <%if $mates|@count gt 0%>
            <ul class="home-members">
	      <%foreach from=$mates item=mate%>
              <li>
		<a href="/users/home/?userid=<%$mate.id%>"><%$mate.realname%></a>
	      </li>
	      <%/foreach%>
            </ul>
	    <%/if%>
	  </dd>
          <dt>子女：</dt>
          <dd itemprop="sons">
	    <%if $sons|@count gt 0%>
            <ul class="home-members">
	      <%foreach from=$sons item=son%>
	      <li>
		<a href="/users/home/?userid=<%$son.id%>"><%$son.realname%></a>
	      </li>
	      <%/foreach%>
	    </ul>
	    <%/if%>
	  </dd>
        </dl>

      </div>
      <%if $affiliate_file%>
      <div class="affiliate">
	<%include file=$affiliate_file%>
      </div>
      <%/if%>

      <div class="clear"></div>

      <%if $authorized || $user.open eq 'public' %>
      <%if $events|@count gt 0%>
      <table>
	<!-- <h3>：</h3> -->
        <caption>生平事迹</caption>
	<% foreach from=$events item=event %>
        <tr>
	  <td><%$event.date%>
	  </td>
	  <td><%$event.event%>
	  </td>
        </tr>
	<%/foreach%>    
      </table>
      <%/if%>
      <%/if%>

      <br/>
      <div class="right">
      返回<a href="/surnames/show?surname=<%$surnameid%>"><%$surname%>氏家谱</a>
      </div>
    </div>
    <div class="clear"></div>    
  </div>
</div>

<%include file="include/bottom.html"%>
